home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 May / macformat-024.iso / Shareware City / Developers / TurboTCP 2.1 / TurboTCP core / TurboTCP.buildflags.h < prev    next >
Encoding:
Text File  |  1995-01-18  |  2.4 KB  |  110 lines  |  [TEXT/MMCC]

  1. //
  2. // TurboTCP.buildflags.h
  3. //
  4. //    TurboTCP library
  5. //    Compile-time flags
  6. //
  7. //    Copyright © 1993-95, FrostByte Design / Eric Scouten
  8. //
  9.  
  10. #pragma once
  11.  
  12.  
  13. //***********************************************************
  14. //
  15. // Use these macros to determine which class library you’re working with. All but one of
  16. // the macros below should be commented out.
  17. //
  18.  
  19. //#define TurboTCP_TCL
  20. #define TurboTCP_PP
  21.  
  22.  
  23. //***********************************************************
  24. //
  25. // Attempt to automatically determine which platform we’re building for.
  26. //
  27.  
  28. #if defined(powerc) || defined(__powerc) || GENERATINGPOWERPC
  29.     #define TurboTCP_PPC 1
  30.     #define TurboTCP_68K 0
  31.     #define TurboTCP_CFM 1
  32.  
  33. #else
  34.     #define TurboTCP_PPC 0
  35.     #define TurboTCP_68K 1
  36.     #if GENERATINGCFM
  37.         #define TurboTCP_CFM GENERATINGCFM
  38.     #else
  39.         #define TurboTCP_CFM 0
  40.     #endif
  41.  
  42. #endif
  43.  
  44.  
  45. //***********************************************************
  46. //
  47. // Attempt to automatically determine which headers we have.
  48. //
  49.  
  50. #include <Types.h>                        // will include <ConditionalMacros.h> if available
  51.  
  52. #if defined(GENERATINGCFM)
  53.     #define TurboTCP_UH2 1
  54.     #define TurboTCP_UH1 0
  55.  
  56. #elif defined(SystemSevenOrLater)        //! WILL NEED TO CHECK THESE OUT!
  57.     #define TurboTCP_UH2 0
  58.     #define TurboTCP_UH1 1
  59.  
  60. #else
  61.     #define TurboTCP_UH2 0
  62.     #define TurboTCP_UH1 0
  63.  
  64. #endif
  65.  
  66.  
  67. #if defined (TurboTCP_TCL)
  68.     #undef TurboTCP_TCL
  69.     #define TurboTCP_TCL    1
  70.     #define TurboTCP_PP    0
  71.     
  72. #elif defined (TurboTCP_PP)
  73.     #undef TurboTCP_PP
  74.     #define TurboTCP_TCL    0
  75.     #define TurboTCP_PP    1
  76.  
  77. #else
  78.     #define TurboTCP_TCL    0
  79.     #define TurboTCP_PP    0
  80.  
  81. #endif
  82.  
  83.  
  84. //***********************************************************
  85. //
  86. // Build exception handling from either TCL or PowerPlant.
  87. //
  88.  
  89. #if TurboTCP_TCL                    // make TCL exceptions look like PowerPlant exceptions
  90.     #include "TCL.h"
  91.     #define Try_ TRY
  92.     #define Catch_(err) CATCH
  93.     #define EndCatch_ ENDTRY;
  94.     #define ThrowIfNil_(ptr) FailNIL(ptr)
  95.     #define ThrowIfOSErr_(err) FailOSErr(err)        //? need to check that this is correct use of FailOSErr
  96.     #define ThrowOSErr_(err) FailOSErr(err)
  97.     #define DontThrowSame_ NO_PROPAGATE
  98.     #define ThrowSame_            // this is default behavior in TCL
  99.  
  100. #else
  101. #if TurboTCP_PP                // use PowerPlant exceptions “as is”
  102.     #include <UException.h>
  103.     #define DontThrowSame_            // this is default behavior in PP
  104.     #define ThrowSame_ Throw_(err)
  105.  
  106. #else                            // make native C++ exceptions look like PowerPlant exceptions
  107.     #error Cannot compile without exception library.
  108.  
  109. #endif
  110. #endif